/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package structures;
import com.google.common.collect.HashBiMap;
/**
 *
 * @author Gonzalo
 */
public class Bimap {
    private HashBiMap<String,Long> bimap;

    public Bimap(int size){
        bimap=HashBiMap.create(size);
    }

    public void put(String _value,long _key){
        bimap.put(_value,_key);
    }

    public long get(String s){
        return bimap.get(s);
    }

    public long putNew(String s){
        long key=bimap.size()+1;
        put(s,key);
        return key;
    }

    public boolean containsKey(String s){
        return bimap.containsKey(s);
    }

 

}
